package oop2;

/**
 * @author oldliu
 * @since 1.0
 */
public class QQ {
    String no, nickname;
    //登记
    int gloden;
    int suns;
    int stars;
    int onlineDays;
    int leftDay;//上次升级之后剩下的

    public void show() {
        System.out.println("当前QQ号：" + no + "昵称：" + nickname);
        System.out.println(gloden + "个皇冠，" + suns + "个太阳，" + stars + "个星星，总在线时长" + onlineDays + "天");
    }

    public void onlineDay() {
        onlineDays++;
        leftDay++;
        if (leftDay >= 100) {
            stars++;
            leftDay -= 100;

        }
        if (stars >= 3) {
            suns++;
            stars -= 3;

        }

        if (suns >= 3) {
            gloden++;
            suns -= 3;
        }
    }
}
